<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <link rel="stylesheet" href="${ctx }/res/css/main.css">
    <link rel="stylesheet" href="${ctx }/res/css/plugins.css">
    <title>软装到家</title>
    <script type="text/javascript" src="${ctx }/res/js/lib.js"></script>
</head>

<body>
<div class="simple-nav reg-nav">
	<div class=" w-1200 margin-0-auto">
    	<img class="fl reg-logo" src="${ctx }/res/img/icon/payment-logo.png">
    </div>
</div>
<div class="factory-reg-body">
	<input type="hidden" name="payBizType" value="${payBizType }" />
	<input type="hidden" name="amount" value="${amount }" />
	<input type="hidden" name="userId" value="${userId }" />
	<input type="hidden" name="paymentNo" value="${paymentNo }" />
    <div class="w-1200 margin-0-auto">
        <div class="payment_dd">
        	<div class="fl">订单提交成功，请您尽快付款。支付单号：${paymentNo }</div>
            <div class="fr" style="padding-right:160px">应付金额 <strong>${amount }</strong> 元</div>
            <div class="m"><img src="${ctx }/res/img/icon/payment.jpg"></div>
        </div>
        <div class="payment_zf payment_zf_curr">
			<div class="title">平台支付</div>
            <div class="jg">支付 <strong>${amount }</strong> 元</div>
            <div class="blank10"></div>
            <ul id="zf">
            	<li data-pay-id="1" data-pay-name="支付宝支付"><div><a><img src="${ctx }/res/img/icon/alipay.jpg"></a></div></li>
                <li data-pay-id="2" data-pay-name="中金支付"><div><a><img src="${ctx }/res/img/icon/online.jpg"></a></div></li>
               <%--  <li data-pay-id="0" data-pay-name="微信支付"><div><a><img src="${ctx }/res/img/icon/wx.jpg"></a></div></li> --%>
            </ul>
            <a onclick="return gotoPay();" class="payment_zf_btn" target="_blank">立即支付</a>
        </div>
        <div class="blank10"></div><div class="blank10"></div><div class="blank10"></div><div class="blank10"></div><div class="blank10"></div>
        <div class="blank10"></div><div class="blank10"></div><div class="blank10"></div><div class="blank10"></div><div class="blank10"></div>
    </div>
</div>
<script language="JavaScript">
	function gotoPay() {  //支付
		var selected = $('#zf li .selected');
		if(selected.length < 1) {
			alert("请选择支付方式!");
		} else if(selected.length > 1) {
			alert("请只选择一种支付方式");
		} else {
			var obj = selected[0];
			var li = $(obj).parents("li");
			var data = $(li).data();
			var payType = data.payId;
			var payBizType = $('input[name="payBizType"]').val();
			var amount = $('input[name="amount"]').val();
			var userId = $('input[name="userId"]').val();
			var paymentNo = $('input[name="payBizType"]').val();
			location = '${ctx}/pay/gotoPay?payType='+payType+'&payBizType='+payBizType+'&orderId='+userId+'&amount='+amount+'&userId='+userId;
		}
	}

	var tds = document.getElementById('zf').getElementsByTagName('div');
	window.onload = function(){
		for( var i=0; i<tds.length; i++ ){
			tds[i].onclick = function(){
				tdonclick(this);
			}
		}
	}
	function tdonclick(obj){
		for( var o=0; o<tds.length; o++ ){
			if( tds[o] == obj ){
				tds[o].className = 'js-brand-item';
			}
			else{
				tds[o].className = '';
			}
		}
	}
	$(function () {
		$("#zf a").click(function () {
	       $(".payment_zf_btn").addClass("payment_zf_btn_curr"); 
		   var url = $(this).attr('pay');
		   $(".payment_zf_btn").attr('href',url);
		});
	});
	
</script>
<%@include file="../foot.jsp" %>
<script type="text/javascript" src="${ctx }/res/js/plugins.js"></script>
<script type="text/javascript" src="${ctx }/res/js/modules.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('.bxslider').bxSlider({
            preloadImages:'all',
            auto:true
        });
    }); 
</script>
</body>
</html>